const express = require('express');
const connection = require('../mysql') // 获取连接实例
const app = express();
const $sql = require('../db');

app.post('/login_sp_ps', (req, res) => {
  var params = req.body;
  var sql = $sql.login_sql.login_sp_ps;
  connection.query(sql,[params.account],(err, user) => {
    if (err) {
      return res.send(err);
    } else {
      if(params.password == user[0].password){
		  return res.json({
        code:200,
        data:user[0]
      })
	  }else{
		  return res.send(404);
	  }
    }
  });
});
module.exports = app;